package client;

import com.jme3.scene.Spatial;
import com.jme3.texture.Texture;
import java.util.List;

/**
 *
 * @author Ben
 */
public class LundWidget
{
    public void printConsoleInfo(String text)
    {
        Main.gameinterface.niftyConsoleC.output("INFO: " + text);
    }
    
    public void printConsoleError(String text)
    {
        Main.gameinterface.niftyConsoleC.output("ERROR: " + text);
    }
    
    public void printConsoleWarning(String text)
    {
        Main.gameinterface.niftyConsoleC.output("WARNING: " + text);
    }
    
    public Texture loadTexture(String path)
    {
        printConsoleInfo("Loading: " + path);
        return Main.appref.getAssetManager().loadTexture(path);
    }
    
    public Spatial findSpatial(String name)
    {
        List<Spatial> children = Main.rendernode.getChildren();
        for(int i = 0; i < children.size();i++)
        {
            if(children.get(i).getName().equals(name))
            {
                return children.get(i);
            }
            else
            {
                return null;
            }
        }
        return null;
    }
}
